<!--#include file="../nav/admin_top.php" -->
<style type="text/css">
table.mytable .mylabel{
width:300px;  
}
span.spans{
color:#333333;
margin-left:20px;
}
</style>
<div class="titleDiv">
	<div class="titleCaption">
		<span class="captionSpan">密码修改</span>
		<span class="totalSpan"> <label id="captionNum"></label> </span>
	</div>
</div>
<div class="menuBg">
	<a class="menuReturn" href="{url::build('admin','index')}">返回管理首页</a>
	<div style="clear:both"></div>	
</div>


 
	<table class="mytable">
		<tbody>
			<tr>
				<td class="mylabel">登录名：</td>
				<td class="myinfo">
					{factory::module('admin')->getusername()}
				</td>
			</tr>
			<tr>
				<td class="mylabel">原密码：</td>
				<td class="myinfo">
					<input id="old_p" name="old_p" type="password" value="" size="16" class="textBox" /> 
					<span class="spans">请输入原密码</span>
				</td>
			</tr>
			<tr>
				<td class="mylabel">新密码：</td>
				<td class="myinfo">
					<input id="new_p" name="new_p" type="password" value="" size="16" class="textBox" />
					<span class="spans">	密码由4-16个英文字母或数字或特殊符号组成</span>
				</td>
			</tr>
			<tr>
				<td class="mylabel">确认新密码：</td>
				<td class="myinfo">
					<input id="new_p2" name="new_p2" type="password" value="" size="16" class="textBox" />
					<span class="spans">请再输入一遍您上面填写的新密码</span>
				</td>
			</tr> 
		</tbody>	
	</table>
	<div class="button_div">
		<button onclick="fnSave()">确 定</button>
		
		<button  onclick="fnReturn()">重 置</button>
	</div>
 
<script type="text/javascript">
$().ready(function(){
	o2js.build('ymprompt');
	showLoading();
	$('#old_p').focus();
 	$('input').bind('keydown',function(e){
		if(e.keyCode==13){
			fnSave();
		}
	});
	
	


	
});
function fnSave(){
	if($('#old_p').val() == '' ){
 
		alert('请输入原密码') 
		$('#old_p').focus();
	 
		return false;
	}
	if($('#new_p').val() == '' ){ 
		alert('请输入新密码') 
		$('#new_p').focus();
  
		return false;
	}
	if($('#new_p').val().length < 4 ){ 
		 
		alert('请输入至少4位新密码') 
		$('#new_p').focus();
		 
		return false;
	}
	if($('#new_p').val() != $('#new_p2').val() ){  
		alert('两次输入的新密码必须相同') 
		$('#new_p2').focus();
		 
		return false;
	} 
	$('button').attr('disabled','disabled');
	$.post(
		'/admin/ajax_chgpwd?reqtype=json',
		{
			old_p:$('#old_p').val(),
			new_p:$('#new_p').val()
		},
		function(e){
			$('button').attr('disabled','');
			var ok = errorHandler(e); 
			if(ok && ok.success=='1'){
 /*
 				GfnAlert({
					str:'修改密码成功！',
					func:function(){　
							jumpTo('/admin/pwd');　
					}
				}); 
 */
				jumpTo('/admin/index');
			}
		}
	);
}
function fnReturn(){
	$('#new_p').val('');
	$('#new_p2').val('');
	$('#old_p').val('').focus();
}
</script>
<!--#include file="../nav/admin_bottom.php" -->